<!--
 (c) Copyright Ascensio System SIA 2020

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 -->
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<script type="text/javascript" src="https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.js"></script>
		<script type="text/javascript" src="https://onlyoffice.github.io/sdkjs-plugins/v1/plugins-ui.js"></script>
		<link rel="stylesheet" href="https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css">
		<script src="vendor/jQuery-2.2.2-min/jquery-v2.2.2-min.js"></script>
		<script src="scripts/d2md.js"></script>
	</head>
	<style>
		html, body {
		 	width: 100%;
			height: 100%;
		}
		.button_wrapper {
			display: flex;
			justify-content: space-between;
		}
		.btn-text-default {
			display: flex;
   			align-items: center;
    		justify-content: center;
		}
		#btn-markwodn {
        	width:40%;
        	margin: 16px 0 16px 12px;
        	text-align: center;
        }
		#btn-html {
			float: right;
			width:40%;
			margin: 16px 12px 16px 0;
        	text-align: center;
        }
        #btn-preview {
        	width:40%;
        	margin: 16px 0 16px 12px;
        	text-align: center;
        }
		#btn-copy {
			float: right;
			width:40%;
			margin: 16px 12px 16px 0;
        	text-align: center;
		}
        #text-area {
        	margin: 16px 12px 0 12px;
        }
        #settings {
        	margin: 16px 12px 0 12px;
        }
        .checkbox {
        	margin-top: 1px;
            margin-left: 5px;
        }
        .input-container {
        	display: flex;
        	margin-bottom: 8px;
        }
        #hide-show-settings {
            width: 130px;
            margin-left: 12px;
        }
        #hide-settings, #show-settings {
            cursor:pointer;
            border-bottom: 1px dashed #333;
        }
        #text-area {
        	height: 100%;
        }
	</style>
	<body class='body' style="margin: 0; display: flex; flex-direction: column;">
		<div class="button_wrapper">
			<div id="btn-markwodn" class="btn-text-default">Markdown</div>
			<div id="btn-html" class="btn-text-default">HTML</div>
		</div>
		<div id="hide-show-settings"><label style="display:none;" id="hide-settings" class="i18n">Hide settings</label><label id="show-settings" class="i18n">Show settings</label></div>
		<div id="settings" style="display: none;">
			<div class="input-container">
				<input type="checkbox" id="demote_headings" data-id="d2md_demote_headings" class="form-control"><label class="checkbox i18n" for="demote_headings">Demote headings (H1 → H2, etc.)</label>
			</div>
			<div class="input-container">
				<input type="checkbox" id="html_headings" data-id="d2md_html_headings" class="form-control"><label class="checkbox i18n" for="html_headings">HTML headings/IDs</label>
			</div>
			<div class="input-container">
				<input type="checkbox" id="base64img" data-id="d2md_base64img" class="form-control"><label class="checkbox i18n" for="base64img">Create base64 images</label>
			</div>
			<div class="input-container">
				<input type="checkbox" id="render_html_tags" data-id="d2md_render_html_tags" class="form-control"><label class="checkbox i18n" for="render_html_tags">Render HTML tags</label>
			</div>
		</div>
		<textarea id="text-area" name="" class="form-control"></textarea>
		<div class="button_wrapper">
			<div id="btn-preview" class="btn-text-default i18n">Preview</div>
			<div id="btn-copy" class="btn-text-default i18n">Copy</div>
		</div>
	</body>
</html>